﻿using System;

namespace Unis.Framework.RuleBase.Attributes
{
    [AttributeUsage(AttributeTargets.Field, AllowMultiple = true)]
    public class NextOwnAttribute : Attribute
    {
        // Fields
        private string _CfgXmlSqlName;
        private string _OwnDescription;
        private string _OwnFieldName;
        private string _OwnFilter;
        private string _OwnTableName;
        private LinkRestrictOption _RestrictOption;

        // Methods
        public NextOwnAttribute(string cfgXmlSqlName, string description)
        {
            this._CfgXmlSqlName = cfgXmlSqlName;
            this._OwnDescription = description;
            this._RestrictOption = LinkRestrictOption.CancelSubmit;
        }

        public NextOwnAttribute(string ownTableName, string ownFieldName, string description)
        {
            this._OwnTableName = ownTableName;
            this._OwnFieldName = ownFieldName;
            this._OwnDescription = description;
            this._RestrictOption = LinkRestrictOption.CancelSubmit;
        }

        public NextOwnAttribute(string ownTableName, string ownFieldName, string filter, string description)
        {
            this._OwnTableName = ownTableName;
            this._OwnFieldName = ownFieldName;
            this._OwnFilter = filter;
            this._OwnDescription = description;
            this._RestrictOption = LinkRestrictOption.CancelSubmit;
        }

        // Properties
        public string CfgXmlSqlName
        {
            get
            {
                return this._CfgXmlSqlName;
            }
        }

        public string OwnDescription
        {
            get
            {
                return this._OwnDescription;
            }
        }

        public string OwnFieldName
        {
            get
            {
                return this._OwnFieldName;
            }
        }

        public string OwnFilter
        {
            get
            {
                return this._OwnFilter;
            }
        }

        public string OwnTableName
        {
            get
            {
                return this._OwnTableName;
            }
        }

        public LinkRestrictOption RestrictOption
        {
            get
            {
                return this._RestrictOption;
            }
            set
            {
                this._RestrictOption = value;
            }
        }
    }
}
